package com.util;

import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * User: HL
 * Date: 2020/3/3
 * Time: 15:31
 * Description: No Description
 */
public class CodeUtil {
    public static String NumberAndLetterCode(){
        //数字和字母的组合
        String baseNumLetter= "123456789abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";
        StringBuffer sBuffer = new StringBuffer();
        String ch = "";
        Random random = new Random();
        for(int i = 0;i < 4;i++){
            int dot = random.nextInt(baseNumLetter.length());
            ch += baseNumLetter.charAt(dot);
        }
        return ch;
    }
}
